package routers

import (
	"codeless/consts"
	"codeless/controller"
	"codeless/event"
	"github.com/gin-gonic/gin"
)

func init() {
	_ = event.Subscribe(consts.ROUTER_INIT_EVENT, func(r *gin.Engine) {
		ctl := controller.CrudController{}
		v1 := r.Group("/crud")
		//v1.Use(middleware.CrudAuth())
		{
			v1.POST("/handler", ctl.Handler)
			v1.GET("/ui", ctl.UI)
		}
	})
}
